<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="panel-fit">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>计划任务管理平台</title>

  <link rel="stylesheet" href="${base}/static/css/index.css">

  <#import "/public/common_easyui.ftl" as common>
  <@common.plan_css/>
  <@common.plan_js/>

  

  <script type="text/javascript">
    function createFrame(url){
      var s = '<iframe scrolling="auto" frameborder="0"  src="'+ url +'" style="width:100%;height:100%;"></iframe>';
      return s;
    }

    $(function(){
      $('#navTree').tree({
        url: '${base}/work/nav.json',
        loadFilter: function(data){
          if(data.code==-1) {
            alert(data.message);
          } else if(data.code==-2) {
            alert('请登陆');
          } else if(data.code==0) {
            return data.data;
          } else {
            alert('操作失败');
          }
        },
        onClick : function(node) {
          $("#tabs").tabs("close",1);
          if(!$("#tabs").tabs("exists",node.text)){
            $("#tabs").tabs("add",{
              title:node.text,
              content:createFrame('${base}'+node.url),
              closable:true
            });
          }else{
            $("#tabs").tabs("select",node.text);
          }
        }
    });
    })
  </script>

</head>
<body>
  <div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'north'" style="height:100px"></div>
    <div data-options="region:'south'" style="height:50px;"></div>
    <div data-options="region:'west',split:true" title="计划管理" style="width:200px;">
        <div class="easyui-accordion" style="height:100%;">
          <div title="我的计划" style="padding:10px;">
            <ul id="navTree" class="easyui-tree"></ul>
          </div>
        </div>
    </div>
    <div data-options="region:'center'" class="easyui-tabs" id="tabs">
        <div title="欢迎使用" style="padding:10px">
          <p style="font-size:14px">欢迎使用</p>
        </div>
    </div>
  </div>
</body>
</html>